<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ taglib uri="/WEB-INF/tlds/att.tld" prefix="att"%>
<html>
<head>
<meta name="decorator" content="moduleView" />
<script src="${staticPath}/lib/accounting/0.3.2/accounting.min.js"
	type="text/javascript"></script>
<script src="${staticPath}/lib/printPage/jquery.printPage.js"
	type="text/javascript"></script>
<script type="text/javascript">
	function getUrl(url) {
		if (!$("#orderDetailFrame").attr("src")) {
			$("#orderDetailFrame").attr("src", url);
		}
	}
</script>
</head>
<body>
	<div class="Report_f">
		<div class="Report_f_1">
			<div class="Report_f_title_1">采购订单明细</div>
			<div class="tab-content Report_f_title_3">
				<div class="Report_f_title_5">
					<!-- <div class="col-sm-2 leftbar_1">
						<ul class="nav Report_f_title_6">
							<li><a href="#label_1" data-toggle="tab">详细信息 </a></li>
							<li><a href="#label_2" data-toggle="tab" onclick="getUrl('${contextPath}/biz/statement/statementOrderDetail/list?orderNo=${statementOrder.orderNo}')">订单明细</a></li>
						</ul>
					</div> -->
					<div class="o-l-action">
						<a class="btn btn-default btn-sm btn_5 pull-right" role="button"
							href="javascript:void(0)" onclick="history.go(-1)">返回</a> <a
							class="btn btn-success btn-sm btn_5 pull-right" role="button"
							href="${contextPath}/biz/statement/statementOrder/ExportDetailToExcel?id=${statementOrder.id}&orderNo=${statementOrder.orderNo}">导出</a>
						<a class="btn btn-primary btn-sm btn_5 pull-right btnPrint"
							role="button"
							href="${contextPath}/biz/statement/statementOrder/print?id=${statementOrder.id}&orderNo=${statementOrder.orderNo}"
							target="_blank">打印</a>

					</div>
					<form:form name="listForm" modelAttribute="statementOrder"
						method="post" class="form-inline" role="form">
						<div class="tab-content Report_f_title_3">
							<div class="tab-pane active" id="home">
								<table class="table table-bordered">
									<tbody>
										<tr>
											<td class="text-left" style="width: 15%"><strong>订单号:</strong></td>
											<td style="width: 35%">${statementOrder.orderNo}</td>

											<td class="text-left" style="width: 15%"><strong>订单类型:</strong></td>
											<td style="width: 35%"><ossp:value dictType="orderType"
													key="${statementOrder.orderType}"></ossp:value></td>
										</tr>
										<tr>
											<td class="text-left" style="width: 15%"><strong>订单状态:</strong></td>
											<td style="width: 35%"><ossp:value
													dictType="ORDER_STATUS" key="${statementOrder.orderStatus}"></ossp:value></td>

											<td class="text-left" style="width: 15%"><strong>供应商联系人:</strong></td>
											<td style="width: 35%">${statementOrder.supplierContact}</td>
										</tr>
										<tr>
											<td class="text-left" style="width: 15%"><strong>供应商编码:</strong></td>
											<td style="width: 35%">${statementOrder.supplierNo}</td>

											<td class="text-left" style="width: 15%"><strong>供应商名称:</strong></td>
											<td style="width: 35%">${statementOrder.supplierName}</td>
										</tr>
										<tr>
											<td class="text-left" style="width: 15%"><strong>订货日期:</strong></td>
											<td style="width: 35%"><fmt:formatDate
													value="${statementOrder.orderDate}" pattern="yyyy-MM-dd" /></td>

											<td class="text-left" style="width: 15%"><strong>交货日期:</strong></td>
											<td style="width: 35%"><fmt:formatDate
													value="${statementOrder.deliveryDate}" pattern="yyyy-MM-dd" /></td>
										</tr>
										<tr>
											<td class="text-left" style="width: 15%"><strong>金额:</strong></td>
											<td style="width: 35%"><fmt:formatNumber
													value="${statementOrder.amount}" pattern="##.##"
													minFractionDigits="2"></fmt:formatNumber></td>

											<td class="text-left" style="width: 15%"><strong>电话:</strong></td>
											<td style="width: 35%">${statementOrder.tel}</td>
										</tr>
										<tr>
											<td class="text-left" style="width: 15%"><strong>订货门店:</strong></td>
											<td style="width: 35%">${statementOrder.orderShopName}</td>

											<td class="text-left" style="width: 15%"><strong>送货门店:</strong></td>
											<td style="width: 35%">${statementOrder.receiptShopName}</td>
										</tr>
									</tbody>
								</table>
							</div>
							<div class="tab-pane" id="label_2">
								<iframe id="orderDetailFrame" name="orderDetailFrame"
									scrolling="no" frameborder="no" width="100%"></iframe>
							</div>
							<div class="o-l-search-builder f_9">
								<table
									class="table table-striped table-hover o-l-table table-bordered"
									id="table1">
									<thead class="t_1">
										<tr>
											<th>商品编码</th>
											<th>商品条码</th>
											<th>商品名称</th>
											<th>规格/型号</th>
											<th>包装率</th>
											<th>含税进价</th>
											<th>订购数量</th>
											<th>进价金额</th>
											<th>税率</th>
										</tr>
									</thead>
									<tbody>
										<c:forEach items="${page.list}" var="statementOrderDetail"
											varStatus="i">
											<c:if test="${i.index<(listSize-1)}">
												<tr data-herf=##
													"${contextPath}/statement/statementStock/${stock.id}/getByStockId"
							data-target="_self">
											</c:if>
											<c:if test="${i.index>=(listSize-1)}">
												<tr>
											</c:if>
											<td>${statementOrderDetail.mantr}</td>
											<td>${statementOrderDetail.barCode}</td>
											<td>${statementOrderDetail.goodsName}</td>
											<c:if test="${i.index<(listSize-1)}">
												<td>${statementOrderDetail.specification}${statementOrderDetail.modelNumber}</td>
											</c:if>
											<c:if test="${i.index>=(listSize-1)}">
												<td></td>
											</c:if>
											<td>${statementOrderDetail.packageRt}</td>
											<td><fmt:formatNumber
													value="${statementOrderDetail.puPrice}" pattern="##.##"
													minFractionDigits="2"></fmt:formatNumber></td>
											<td>${statementOrderDetail.quantity}</td>
											<td><fmt:formatNumber
													value="${statementOrderDetail.amount}" pattern="##.##"
													minFractionDigits="2"></fmt:formatNumber></td>
											<td><fmt:formatNumber
													value="${statementOrderDetail.taxRate}" pattern="##"
													minFractionDigits="0"></fmt:formatNumber></td>
											</tr>
										</c:forEach>
									</tbody>
								</table>
							</div>
							<pager:pager pageSize="${page.pageSize}" pageNo="${page.pageNo}"
								url="" total="${page.total}" />
							<script type="text/javascript" src="${staticPath}/js/list.js"></script>
						</div>
					</form:form>
				</div>
			</div>
		</div>
</body>
</html>